home *** CD-ROM | disk | FTP | other *** search
/ Chip 2005 August (Alt) / CHIP 2005-08.1.iso / program / guvenlik / syslinux-3.07.exe / memdisk / memdisk.doc < prev    next >
Encoding:
Text File  |  2004-12-29  |  5.8 KB  |  185 lines

  1. $Id: memdisk.doc,v 1.16 2004/12/29 19:34:13 hpa Exp $
  2. [This documentation is rather crufty at the moment.]
  3.  
  4. MEMDISK is meant to allow booting legacy operating systems via PXE,
  5. and as a workaround for BIOSes where ISOLINUX image support doesn't
  6. work.
  7.  
  8. MEMDISK simulates a disk by claiming a chunk of high memory for the
  9. disk and a (very small - 2K typical) chunk of low (DOS) memory for the
  10. driver itself, then hooking the INT 13h (disk driver) and INT 15h
  11. (memory query) BIOS interrupts.
  12.  
  13. To use it, type on the SYSLINUX command line:
  14.  
  15. memdisk initrd=diskimg.img
  16.  
  17. ... where diskimg.img is the disk image you want to boot from.
  18.  
  19. [Obviously, the memdisk binary as well as your disk image file need to
  20. be present in the boot image directory.]
  21.  
  22. ... or add to your syslinux.cfg/pxelinux.cfg/isolinux.cfg something like:
  23.  
  24. label dos
  25.     kernel memdisk
  26.     append initrd=dosboot.img
  27.  
  28. Note the following:
  29.  
  30. a) The disk image can be uncompressed or compressed with gzip or zip.
  31.  
  32. b) If the disk image is one of the following sizes, it's assumed to be a
  33.    floppy image:
  34.  
  35.      368,640 bytes -  360K floppy
  36.      737,280 bytes -  720K floppy
  37.    1,222,800 bytes - 1200K floppy
  38.    1,474,560 bytes - 1440K floppy
  39.    1,720,320 bytes - 1680K floppy (common extended format)
  40.    1,763,328 bytes - 1722K floppy (common extended format)
  41.    2,949,120 bytes - 2880K floppy
  42.    3,932,160 bytes - 3840K floppy (extended format)
  43.  
  44.    For any other size, the image is assumed to be a hard disk image,
  45.    and should typically have an MBR and a partition table.  It may
  46.    optionally have a DOSEMU geometry header; in which case the header
  47.    is used to determine the C/H/S geometry of the disk.  Otherwise,
  48.    the geometry is determined by examining the partition table, so the
  49.    entire image should be partitioned for proper operation (it may be
  50.    divided between multiple partitions, however.)
  51.  
  52.    You can also specify the geometry manually with the following command
  53.    line options:
  54.  
  55.    c=<number>    Specify number of cylinders (max 1024[*])
  56.    h=<number>    Specify number of heads (max 256[*])
  57.    s=<number>    Specify number of sectors (max 63)
  58.    floppy    The image is a floppy image
  59.    harddisk    The image is a hard disk image
  60.  
  61.    [*] MS-DOS only allows max 255 heads, and only allows 255 cylinders
  62.        on floppy disks.
  63.  
  64. c) The disk is normally writable (although, of course, there is
  65.    nothing backing it up, so it only lasts until reset.)  If you want,
  66.    you can mimic a write-protected disk by specifying the command line
  67.    option:
  68.  
  69.    ro        Disk is readonly
  70.  
  71. d) MEMDISK normally uses the BIOS "INT 15h mover" API to access high
  72.    memory.  This is well-behaved with extended memory managers which load
  73.    later.  Unfortunately it appears that the "DOS boot disk" from
  74.    WinME/XP *deliberately* crash the system when this API is invoked.
  75.    The following command-line option tells MEMDISK to enter protected
  76.    mode directly, whenever possible:
  77.  
  78.    raw        Use raw access to protected mode memory
  79.  
  80.  
  81.  
  82. Some interesting things to note:
  83.  
  84. If you're using MEMDISK to boot DOS from a CD-ROM (using ISOLINUX),
  85. you might find the generic El Torito CD-ROM driver by Gary Tong and
  86. Bart Lagerweij useful:
  87.  
  88.     http://www.nu2.nu/eltorito/
  89.  
  90.  
  91. Similarly, if you're booting DOS over the network using PXELINUX, you
  92. can use the "keeppxe" option and use the generic PXE (UNDI) NDIS
  93. network driver, which is part of the PROBOOT.EXE distribution from
  94. Intel:
  95.  
  96.     http://www.intel.com/support/network/adapter/1000/software.htm
  97.  
  98.  
  99. Additional technical information:
  100.  
  101. Starting with version 2.08, MEMDISK now supports an installation check
  102. API.  This works as follows:
  103.  
  104.     EAX = 454D08xxh ("ME") (08h = parameter query)
  105.     ECX = 444Dxxxxh ("MD")
  106.     EDX = 5349xxnnh    ("IS") (nn = drive #)
  107.     EBX = 3F4Bxxxxh ("K?")
  108.     INT 13h
  109.  
  110. If drive nn is a MEMDISK, the registers will contain:
  111.  
  112.     EAX = 4D21xxxxh    ("!M")
  113.     ECX = 4D45xxxxh ("EM")
  114.     EDX = 4944xxxxh ("DI")
  115.     EBX = 4B53xxxxh ("SK")
  116.  
  117.     ES:DI -> MEMDISK info structures
  118.  
  119. The low parts of EAX/ECX/EDX/EBX have the normal return values for INT
  120. 13h, AH=08h, i.e. information of the disk geometry etc.
  121.  
  122. See Ralf Brown's interrupt list,
  123. http://www.cs.cmu.edu/afs/cs.cmu.edu/user/ralf/pub/WWW/files.html or
  124. http://www.ctyme.com/rbrown.htm, for a detailed description.
  125.  
  126. The MEMDISK info structure currently contains:
  127.  
  128.     [ES:DI]        word    Total size of structure (currently 27 bytes)
  129.     [ES:DI+2]    byte    MEMDISK minor version
  130.     [ES:DI+3]    byte    MEMDISK major version
  131.     [ES:DI+4]    dword    Pointer to MEMDISK data in high memory
  132.     [ES:DI+8]    dword    Size of MEMDISK data in 512-byte sectors 
  133.     [ES:DI+12]    16:16    Far pointer to command line
  134.     [ES:DI+16]    16:16    Old INT 13h pointer
  135.     [ES:DI+20]    16:16    Old INT 15h pointer
  136.     [ES:DI+24]    word    Amount of DOS memory before MEMDISK loaded
  137.     [ES:DI+26]    byte    Boot loader ID
  138.  
  139. MEMDISK 3.00 and higher has the size of this structure as 27; earlier
  140. versions had size 26 and did not include the boot loader ID.
  141.  
  142. In addition, the following fields are available at [ES:0]:
  143.  
  144.     [ES:0]        word    Offset of INT 13h routine (segment == ES)
  145.     [ES:2]        word    Offset of INT 15h routine (segment == ES)
  146.  
  147. The program mdiskchk.c in the sample directory is an example on how
  148. this API can be used.
  149.  
  150. The following code can be used to "disable" MEMDISK.  Note that it
  151. does not free the handler in DOS memory, and that running this from
  152. DOS will probably crash your machine (DOS doesn't like drives
  153. suddenly disappearing from underneath):
  154.  
  155.     mov eax, 454D0800h
  156.     mov ecx, 444D0000h
  157.     mov edx, 53490000h + drive #
  158.     mov ebx, 3F4B0000h
  159.     int 13h
  160.  
  161.     shr eax, 16
  162.     cmp ax, 4D21h
  163.     jne not_memdisk
  164.     shr ecx, 16
  165.     cmp cx, 4D45h
  166.     jne not_memdisk
  167.     shr edx, 16
  168.     cmp dx, 4944h
  169.     jne not_memdisk
  170.     shr ebx, 16
  171.     cmp bx, 4B53h
  172.     jne not_memdisk
  173.  
  174.     cli
  175.     mov bx,[es:0]        ; INT 13h handler offset
  176.     mov eax,[es:di+16]    ; Old INT 13h handler
  177.     mov byte [es:bx], 0EAh    ; FAR JMP
  178.     mov [es:bx+1], eax
  179.  
  180.     mov bx,[es:2]        ; INT 15h handler offset
  181.     mov eax,[es:di+20]    ; Old INT 15h handler
  182.     mov byte [es:bx], 0EAh    ; FAR JMP
  183.     mov [es:bx+1], eax
  184.     sti
  185.